﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BaiTu.IDAL
{
    /// <summary>
    /// 数据 工作单元 接口
    /// </summary>
    public interface IUnitOfWorkContext:IUnitOfWork,IDisposable
    {
        /// <summary>
        /// 注册一个新的对象到仓储上下文对象中
        /// </summary>
        /// <typeparam name="TEntity"></typeparam>
        /// <param name="entity"></param>
        void RegisterNew<TEntity>(TEntity entity) where TEntity : Domains.BaseDomain;
        /// <summary>
        /// 批量注册多个新的对象到仓储上下文中
        /// </summary>
        /// <typeparam name="TEntity"></typeparam>
        /// <param name="entities"></param>
        void RegisterNew<TEntity>(IEnumerable<TEntity> entities) where TEntity : Domains.BaseDomain;
        /// <summary>
        /// 注册一个更改的对象到仓储上下文中
        /// </summary>
        /// <typeparam name="TEntity"></typeparam>
        /// <param name="entity"></param>
        void RegisterModified<TEntity>(TEntity entity) where TEntity : Domains.BaseDomain;
        /// <summary>
        /// 注册一个删除的对象到仓储上下文中
        /// </summary>
        /// <typeparam name="TEntity"></typeparam>
        /// <param name="entity"></param>
        void RegisterDeleted<TEntity>(TEntity entity) where TEntity : Domains.BaseDomain;
        /// <summary>
        /// 批量注册多个删除的对象到仓储上下文中
        /// </summary>
        /// <typeparam name="TEntity"></typeparam>
        /// <param name="entities"></param>
        void RegisterDeleted<TEntity>(IEnumerable<TEntity> entities) where TEntity : Domains.BaseDomain;

    }
}
